| Tutorial 4 - Filtering with Matlab Filter Design and Signal Processing toolboxes |
|
This tutorial is an introduction to Matlab fdatool (Filter Design and Analysis) and sptool (Signal Processing) interfaces. You can check if you have the two toolboxes looking for the folders Filter Design and Signal Processing typing 'ver' in your Matlab Workspace (current directory main Matlab folder, eg. C:\\Matlab7\). The Matlab Help provides detailed descriptions of the built-in functions and the different options used in fdatool and sptool.
The tutorial is organized in 2 parts: first the design of a filter that will then be used to process a seismic signal. The record of the tectonic event signal can be found here (file nov1.txt). The signal sampling frequency is 50 Hz. Filtering is used to identify and locate the seismic wave phases (see Tutorial1 for an introduction to filtering). Here, our aim will be to isolate the body waves (P- and S- waves) removing in particular the low frequency Surface waves. The various waves properties make the use of a Bandpass Butterworth filter with cut-off frequencies of 0.5 Hz and 1.5 Hz adequate.
1. Filter Design and Analysis: fdatool The fdatool can be called from your Matlab Workspace typing simply 'fdatool' (current directory: main Matlab folder). The following image presents the FDA interface that should pop-up on your screen, and underlines its main parts.
Roll your mouse over the figure for an overview of the functions/menu we'll use here
The bottom left corner box allows to choose the algorithm / type of filter used. Depending on the filter, the possible options in the 3 other bottom boxes changes. The top right corner box images the chosen filter properties and the specifications required to design it.
The Butterworth filter we want to build has the following properties:
This small animation might give you a better idea of the different steps necessary to design such a filter (choice of the filter, filter specifications), of the Magnitude (dB and linear scale) and Impulse Response visualization tool offered by the Analysis menu, and of the ability to export the designed filter directly into sptool.
Use the arrows and some of the colored areas to navigate between figures, and build the filter yourself with Matlab / fdatool.
2. Filtering the seismic signal : sptool When you export the filter toward sptool, the sptool interface should open automatically. However if you want to open the GUI directly from the Workspace, type 'sptool' (current directory: main Matlab folder). In addition to the filter, the seismic signal has to be imported. In the nov1 file case, as ofter for signal files, the header first has to be erased for Matlab (or other software like lpitsa) to read it properly. The nov1 signal being a .txt format, the fastest way to download it in sptool is to import it first in the Matlab Workspace using the command 'load ('nov1.txt')' (with current directory: nov1.txt folder). The file can then be import from the sptool / File / Import menu, choosing the Import from Workspace option, and setting the Sampling frequency to 50 Hz.
This animated figure presents the loading and importing steps of nov1 leading to the sptool interface once both the filter and seismic signal were imported (Picture 3). Signals and Filters are listed in 2 columns, a third column corresponding to the signals spectra. Signal, Filters and Spectra have there own menu listed down the column. Several of the tools offered by sptool can be explored through the figure.
Navigate in the amination clicking on the orange arrows for viewing the slides in order, and using the purple arrow to come back to Picture 3.
The Signal/View link leads to Picture 4 that shows the interface for viewing signals, highlighting the display utilities like 'zoom' and 'line properties' that are also used later on in the animation (Parts 5 and 6).
The Filters/Apply link leads to the Applying Filter interface (Part) allowing to filter nov1 using our Butterworth filter.
Click on the Apply Button, View the filtered signal (nov1_filtered)
The Spectra/Create link allows to check the efficiency of the filter computing the spectrum of the filtered signal using the wanted method, here we used the Fast Fourier Trasform (Picture 7, also accessible from Part5). Most of the energy stands between the cutoff frequencies although some remains at low-frequency, suggesting we could refine the filter.
The Filters/New link brings to the sptool Filter Designer interface. The same steps than with fdatool can be followed to design a Butterworth filter and examining the filter response. The comparison between the 2 filters indicates that these differently built filters give slighlty different filtered signals.
|
| < Prev | Next > |
|---|
